var fun=function(jQuery, window, document) {
    function d(b) {
        return this.each(function () {
            var c = jQuery(this);
            new e(c, b)
        })
    }

    var e = function (b, c) {
        this.options = jQuery.extend({}, e.DEFAULTS, c), this.$element = b, this.subEleNum = this._getSubjects().length, this.init()
    };
    e.DEFAULTS = {
        subMarginSize: "12px",
        subWrapName: ".solu-film",
        subName: ".solu-category",
        moveControl: ".carousel-control",
        subListName: ".case-list",
        subPointer: ".pointer"
    }, e.prototype = {
        _getSubjects: function (a, b) {
            return "active" == a ? this.$element.find(this.options.subName + ".active") : this.$element.find(b ? b : this.options.subName)
        }, _getSubWidth: function () {
            return this._getSubjects().outerWidth()
        }, _getMvDistance: function () {
            return this._getSubWidth() + 2 * parseInt(this.options.subMarginSize)
        }, _getSubActiveWidth: function () {
            return this._getSubjects("active").outerWidth()
        }, _getEleWidth: function () {
            return (this._getSubjects().length - 1) * this._getMvDistance() + (this._getSubActiveWidth() + 2 * parseInt(this.options.subMarginSize))
        }, _disableLinks: function (b) {
            b && b.on("click", function (b) {
                jQuery(this).is("[disabled]") && b.preventDefault()
            }), this._getSubjects().on("click", function (b) {
                jQuery(this).is("[disabled]") && b.preventDefault()
            })
        }, _setActiveLinkToWrap: function (a) {
            var b, c = a ? a : this._getSubjects("active"), d = c.find(".solu-btn");
            return c.hasClass("active") && d.is(":hidden") && (b = d.attr("href"), c.css("cursor", "pointer").off("click").on("click", function () {
                location.href = b
            }), c.siblings().off("click")), this
        }, _setEleWidth: function () {
            return this.$element.find(this.options.subWrapName).css({width: this._getEleWidth() + 10})
        }, _getCenter: function () {
            return Math.ceil(this.subEleNum / 2)
        }, _getCenterEle: function () {
            return this._getSubjects().eq(this._getCenter() - 1)
        }, _setSubOpacity: function (a) {
            var b, c = this._getSubjects(), d = a.index(), e = 1;
            c.css({cursor: "pointer", "background-color": "#f8fafc"}).attr("disabled", "disabled");
            var f = [a, a.prev(), a.next()];
            for (b = 0; b < f.length; b++) {
                var g = {};
                g = 0 == b ? {opacity: 1, cursor: "default", "background-color": "white"} : {
                    opacity: 1,
                    "background-color": "white"
                }, f[b].css(g).removeAttr("disabled")
            }
            for (b = 2; b < this.subEleNum; b++)e = 1 - 3 * (b - 1) * .1 > 0 ? 1 - 3 * (b - 1) * .1 : .1, d - b >= 0 && c.eq(d - b).css("opacity", e), d + b < this.subEleNum && c.eq(d + b).css("opacity", e);
            return this
        }, _setActiveObj: function (a) {
            return a.addClass("active").removeAttr("disabled").siblings().removeClass("active").attr("disabled", "disabled"), this._setSubOpacity(this._getSubjects("active")), this
        }, _getMoveDistance: function () {
            var a = this._getMvDistance();
            return a * (this._getCenter() - 1) + this._getSubActiveWidth() / 2 + parseInt(this.options.subMarginSize)
        }, _moveToCenter: function (c, d) {
            var e, f, g, h, i = this.$element.find(this.options.subWrapName), j = isNaN(d) ? 500 : d, k = this;
            return i.is(":animated") ? void 0 : i.animate({marginLeft: "-" + c + "px"}, {
                duration: j,
                complete: function () {
                    e = k._getSubjects().first(), f = k._getSubjects().last(), g = e.offset().left, h = jQuery(window).width() - f.offset().left - k._getSubWidth();
                    var c = Math.ceil((g + k._getMvDistance()) / k._getMvDistance()), d = Math.ceil((h + k._getMvDistance()) / k._getMvDistance());
                    if (c > 0) {
                        for (var j = 0; c > j; j++)f = k._getSubjects().last(), f.remove().prependTo(k.options.subWrapName), k._disableLinks(f);
                        i.css("margin-left", "-=" + k._getMvDistance() * c), k._setSubOpacity(k._getSubjects("active"))
                    }
                    if (d > 0) {
                        for (var l = 0; d > l; l++)e = k._getSubjects().first(), e.remove().appendTo(k.options.subWrapName), k._disableLinks(e);
                        i.css("margin-left", "+=" + k._getMvDistance() * d), k._setSubOpacity(k._getSubjects("active"))
                    }
                    k._ctrlClickToCentre(), k._handleDetailBtn()
                }
            })
        }, _runMainLayout: function () {
            this._disableLinks();
            var a = this._getSubjects("active"), b = a.index();
            return a.length > 0 ? (this._setEleWidth(), this._setSubOpacity(a), this._moveToCenter(this._getMvDistance() * b + this._getSubActiveWidth() / 2 + parseInt(this.options.subMarginSize), 0)) : (this._setActiveObj(this._getCenterEle()), this._setEleWidth(), this._moveToCenter(this._getMoveDistance(), 0)), this
        }, _reFreshLayout: function () {
            var a = this._getSubjects("active"), b = a.index();
            return this._setEleWidth(), this._setSubOpacity(a), this._moveToCenter(this._getMvDistance() * b + this._getSubActiveWidth() / 2 + parseInt(this.options.subMarginSize), 0), this
        }, _getCurrentMargin: function () {
            return this.$element.find(this.options.subWrapName).css("margin-left")
        }, _getCurrentActiveSub: function () {
            return this._getSubjects("active")
        }, _aniSwitch: function (a, b) {
            return b ? a.show().animate({opacity: 1}, 500).siblings(b).attr("style", "") : a.css({opacity: 0}).animate({opacity: 1}, 500)
        }, _showCurrentActiveList: function () {
            var b = this._getSubjects("", this.options.subListName), c = jQuery(this.options.subPointer), d = this._getCurrentActiveSub().index();
            b.is(":animated") || (this._aniSwitch(b.eq(d), this.options.subListName), this._aniSwitch(c))
        }, _getTouchDir: function (a) {

        }, _controlToCenter: function () {
            var b, c = this, d = this.$element.find(this.options.moveControl);
            this._getTouchDir(function (a) {
                var b;
                b = "left" != a, c._runSubMove(b)
            }), d.on("click", function () {
                b = jQuery(this).hasClass("left"), c._runSubMove(b)
            })
        }, _getToCentreDistance: function (b) {
            var c, d, e, f = this._getSubjects(), g = this;
            f.on("click", function (f) {
                c = g._getSubjects("active").index(), d = jQuery(this).index(), e = d - c, b && b(d, e)
            })
        }, _ctrlClickToCentre: function () {
            var a, b = this;
            return this._getToCentreDistance(function (c, d) {
                a = b._getSubjects().eq(c), d > 0 ? b._runSubMove(!1, Math.abs(d), c) : 0 > d && b._runSubMove(!0, Math.abs(d), c)
            }), this
        }, _runSubMove: function (a, b, c) {
            if (!this.$element.find(this.options.subWrapName).is(":animated")) {
                var d, e = this._getSubjects("active").index();
                d = b ? this._getMvDistance() * b : this._getMvDistance();
                var f = this._getCurrentMargin();
                e = a ? e - 1 : e + 1, null != c ? this._setActiveObj(this._getSubjects().eq(c)) : this._setActiveObj(this._getSubjects().eq(e)), this._moveToCenter(a ? Math.abs(parseInt(f) + d) : Math.abs(parseInt(f) - d)), this._setActiveLinkToWrap()
            }
        }, _handleDetailBtn: function () {
            var b = this._getSubjects(), c = b.find("a"), d = this;
            c.click(function (b) {
                var c = jQuery(this).parents(d.subName).attr("disabled");
                "disabled" != c && b.stopPropagation()
            })
        }, init: function () {
            var c = this;
            this._disableLinks(), this._runMainLayout(), this._setActiveLinkToWrap(), jQuery(window).resize(function () {
                c._reFreshLayout()
            }), this._controlToCenter(), this._ctrlClickToCentre(), this._handleDetailBtn()
        }
    }, jQuery.fn.moveFilm = d, jQuery.fn.moveFilm.Constructor = e
};
fun($,window,document)
